import request from '/@/utils/request';

/**
 * 系统部门
 */
export function deptApi() {
	return {
		queryTreeAll: (params?: object)=> {
			return request({
				url: import.meta.env.VITE_APP_BASE_API+'/system/dept/queryTreeAll',
				method: 'get',
				params
			});
		},
		queryTree: (params?: object)=> {
			return request({
				url: import.meta.env.VITE_APP_BASE_API+'/system/dept/queryTree',
				method: 'get',
				params
			});
		},
		edit: (params?: object)=> {
			return request({
				url: import.meta.env.VITE_APP_BASE_API+'/system/dept',
				method: 'put',
				data: params
			});
		},
		query: (id?: number | string)=> {
			return request({
				url: import.meta.env.VITE_APP_BASE_API+'/system/dept/'+id,
				method: 'get'
			});
		},
		insert: (params?: object) => {
			return request({
				url: import.meta.env.VITE_APP_BASE_API+'/system/dept',
				method: 'post',
				data: params
			});
		},
		delete: (id?: number | string) => {
			return request({
				url: import.meta.env.VITE_APP_BASE_API+'/system/dept/' + id,
				method: 'delete'
			});
		},
	};
}
